import { defineStore } from "pinia";
import { MenuState } from "@/stores/interface";

export const useMenuStore = defineStore({
  id: "menu-map",
  state: (): MenuState => ({
    // 菜单权限列表
    menuList: [],
    // 当前页面的 router name，用来做按钮权限筛选
    routeName: ""
  }),
  getters: {
    menuListGet: state => state.menuList,
  },
  actions: {
    async setMenuList(data: any) {
      this.menuList = data;
    },
    // Get MenuList By API
    async getMenuList() {
      // this.menuList = data;
    },
    // Set RouteName
    async setRouteName(name: string) {
      this.routeName = name;
    }
  }
});
